﻿<div ng-controller="logisticsController">
    <div class="wrapper border-bottom white-bg page-heading">
        <div class="col-lg-pull-12">
            <ol class="breadcrumb">
                <li>物流订单</li>
            </ol>
        </div>
    </div>

    <form class="form-horizontal row">
        <div class="form-group">
            <div class="col-sm-4">
                <label class="col-sm-4 control-label">物流号</label>
                <div class="col-sm-8">
                    <input name="merchant_id" type="text" class="form-control input-sm" ng-model="query.logistics_no">
                </div>
            </div>
            <div class="col-sm-4">
                <label class="col-sm-4 control-label">航空号</label>
                <div class="col-sm-8">
                    <input name="order_no" type="text" class="form-control input-sm" ng-model="query.flight_no">
                </div>
            </div>
            <div class="col-sm-4">
                <label class="col-sm-4 control-label">邮政物流单号</label>
                <div class="col-sm-8">
                    <input name="order_no" type="text" class="form-control input-sm" ng-model="query.postal_no">
                </div>
            </div>
        </div>
        <div class="form-group">
            <div class="col-sm-4">
                <label class="col-sm-4 control-label">物流状态</label>
                <div class="col-sm-8">
                    <select class="form-control input-sm" ng-model="query.logisticsstatus">
                        <option value="">全部</option>
                        <option value="1">备货</option>
                        <option value="2">提单</option>
                        <option value="3">分板</option>
                        <option value="4">运单航班</option>
                        <option value="5">空运航班抵达目的地</option>
                        <option value="6">身份信息匹配</option>
                        <option value="7">到库分栋，开始清关</option>
                        <option value="8">清关完成开始配送</option>
                        <option value="9">国内物流</option>
                    </select>
                </div>
            </div>
        </div>
        <div class="form-group">
            <div class="col-sm-4">
                <div class="col-sm-offset-4 col-sm-8">
                    <button class="btn btn-primary btn-sm" ng-click="search()"><i class="fa fa-search"></i> 查询</button>
                </div>
            </div>
        </div>
    </form>
    <table class="table table-hover m-t-md">
        <thead>
            <tr style="background-color: #f7f7f9;">
                <th>板/单号</th>
                <th>板/单名称</th>
                <th>航班号</th>
                <th>邮政单号</th>
                <th>物流状态</th>
                <th>物流更新时间</th>
                <th width="65">操作</th>
            </tr>
        </thead>
        <tbody ng-repeat="item in model.rows">
            <tr>
                <td>{{item.board_no}}</td>
                <td>{{item.board_name}}</td>
                <td>{{item.flightno}}</td>
                <td>{{item.postalno}}</td>
                <td>{{get_logistics_status(item.statuss)}}</td>
                <td>{{item.create_time}}</td>
                <td>
                    <a class="btn btn-primary btn-xs" ng-if="item.statuss == 5" ng-click="logistics_excel(item.id,1)" id="export{{item.id}}"><i class="fa fa-cog"></i> 推送物流运单</a>
                    <a class="btn btn-primary btn-xs" ng-if="item.statuss == 5" ng-click="logistics_excel(item.id,2)" id="exports{{item.id}}"><i class="fa fa-cog"></i> 推送物流清单</a>
                </td>
            </tr>
            <tr style="background-color:gainsboro" ng-repeat="payinfo in item.payinfos">
                <td>支付单号:{{payinfo.pay_no}}</td>
                <td>支付名称:{{payinfo.pay_name}}</td>
                <td>交易流水单号:{{payinfo.transaction_no}}</td>
                <td>结算类型:{{pay_type(payinfo.pay_type)}}</td>
                <td>支付时间:{{payinfo.pay_time}}</td>
                <td>创建时间:{{payinfo.create_time}}</td>
                <td>
                    <a class="btn btn-primary btn-xs" ng-if="item.statuss == 5" ng-click="push_order(payinfo.id)"><i class="fa fa-cog"></i> 推送订单</a>
                    <a class="btn btn-primary btn-xs" ng-if="item.statuss == 5" ng-click="push_pay_order(payinfo.id)"><i class="fa fa-cog"></i> 推送支付单</a>
                </td>
            </tr>
        </tbody>
    </table>
    <div class="row">
        <div class="col-md-12">
            <uib-pagination total-items="model.total_result" items-per-page="model.size" ng-model="model.page" num-pages="model.total_pages"
                            ng-change="search_page(model.page)" class="pagination-sm" boundary-links="true" boundary-link-numbers="true" max-size="20"
                            previous-text="&lsaquo;" next-text="&rsaquo;" first-text="&laquo;" last-text="&raquo;"></uib-pagination>
            <span class="pull-right" style="margin: 30px 0px 20px 0px">共{{model.total_result}} 当前：{{model.page}}/{{model.total_pages}}</span>
        </div>
    </div>
</div>
